Implement in-place SPSS transformations - #7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0303873d2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if old_set is not None: | ||
| connection.execute(delete(core.value_label).where( | ||
| core.value_label.c.value_label_set_id == old_set | ||
| )) |
There was a problem hiding this comment.
Preserve shared value-label sets when replacing labels
When two variables reference the same valid value_label_set, replacing labels for either variable deletes the shared label rows before removing only that variable's association. PostgreSQL/MySQL will reject the later parent deletion because the other association still references it, while SQLite configurations without foreign-key enforcement leave the other variable pointing to an empty or nonexistent set. Detach the current variable first and delete the old set and labels only when no other variables reference it.
Useful? React with 👍 / 👎.
Implements the canonical SPSS-like frontend and product-neutral in-place executor for SQLite, PostgreSQL, MySQL, MariaDB, and Dolt. Mutates the existing dataset/table, adds compact audit and CLI/API, rejects non-atomic schema changes before mutation, and creates no undo/copy/snapshot/derived dataset layer.